;(function () {
    // 步骤3：创建echarts实例
let myChart = echarts.init(document.querySelector('.l2'))

let option = {

    dataset: [
      {
        source: [
          ['Product', 'Sales', 'Price', 'Year'],
          ['Dumpling', 341, 25, 2011],
          ['Biscuit', 122, 29, 2011],
          ['Cereal', 201, 19, 2012],
          ['Dumpling', 241, 27, 2012],
          [ 'Cake', 153, 28, 2013],
          ['Cereal', 181, 21, 2013],
          ['Cake', 223, 29, 2014],
          ['Dumpling', 211, 35, 2014],
        ]
      },
      {
        transform: {
          type: 'filter',
          config: { dimension: 'Year', value: 2011 }
        }
      },
      {
        transform: {
          type: 'filter',
          config: { dimension: 'Year', value: 2012 }
        }
      },
      {
        transform: {
          type: 'filter',
          config: { dimension: 'Year', value: 2013 }
        }
      }
    ],
    series: [
      {
        type: 'pie',
        radius: [30,40],
        center: 200,
        datasetIndex: 1,
        label: {
            show: false
         },
      },
      {
        type: 'pie',
        radius: [30,40],
        center: 200,
        datasetIndex: 2,
        label: {
            show: false
         },
      },
      {
        type: 'pie',
        radius: [30,40],
        center: 200,
        datasetIndex: 3,
        label: {
            show: false
         },
      }
    ],
    // Optional. Only for responsive layout:
    media: [
      {
        query: { minAspectRatio: 1 },
        option: {
          series: [
            { center: ['15%', '50%'] },
            { center: ['50%', '50%'] },
            { center: ['85%', '50%'] }
          ]
        }
      },
    //   {
    //     option: {
    //       series: [
    //         { center: ['50%', '25%'] },
    //         { center: ['50%', '50%'] },
    //         { center: ['50%', '75%'] }
    //       ]
    //     }
    //   }
    ]
  };


myChart.setOption(option)

window.addEventListener('resize', () => {
    myChart.resize()
})
}) ()


